<div class="widget">
    <div class="widgetTitle">
        <h3><?= $title; ?> </h3>
    </div>

    <div class="widgetContent bottom-border">
        <div class="row nomargin">

            <div class="block">
                <a class="btn btn-info" href="<?= URL::base();?>/products/add/<?= $post->id;?>">Add Product</a>
            </div>


            
            <div class="col-md-12 col-sm-12 col-xs-12">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>Image</th>
                        <th>Description</th>
                        <th>Hits</th>
                        
                    </tr>
                    </thead>
                    <tbody>

                   <?php foreach($products as $product):?>

                        <tr>
                        <td>
                                    <img src="<?= URL::base().'/storage/uploads/products/'.$product->image;?>" >
                                </td>
                       <td>         <span class="smallText"><?= Str::limit($product->description,170);?> </span>
                                    <p class="text-dark-orange">Price : <?= $product->price;?></p>
                           
                       </td>
                       <td><span class="badge">50</span></td>
                         <td>
                         <a title="Edit Product" href="<?= URL::base();?>/products/edit/<?= $product->id;?>" class="btn btn-xs btn-info"><i class="fa fa-edit"></i></a>
                        </td>
                         <td>
                         <a title="Delete Product" href="<?= URL::base();?>/products/delete/<?= $product->id;?>/<?= $product->image;?>" class="btn btn-xs btn-warning" <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>><i class="fa fa-remove"></i></a>
                        </td>
                        
                    </tr>
                    <?php endforeach;?>

                    </tbody>
                </table>
            </div>


                       

        </div>
    </div>
</div>